package lily.ui.bookshelf;

import android.content.Context;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.WindowManager;

/**
 * 界面初始化时计算屏幕的宽高，从而计算书架和档案袋的大小
 * @author heckassitant
 *
 */
public class WindowSizeUtil {
	
	private static final String TAG = "case";
	
	public int ScreenWidth;
	public int ScreenHeight;
	
	public WindowSizeUtil(Context context){
		//构造函数
		WindowManager wm = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
		DisplayMetrics dm = new DisplayMetrics();
		wm.getDefaultDisplay().getMetrics(dm);
		ScreenWidth = dm.widthPixels;//(dm.widthPixels<dm.heightPixels)?dm.widthPixels:dm.heightPixels;
		ScreenHeight = dm.heightPixels;//(dm.widthPixels>dm.heightPixels)?dm.widthPixels:dm.heightPixels;
	
		//Log.i(TAG, "ScreenWidth="+ScreenWidth+",ScreenHeight="+ScreenHeight);
	}
	
}
